﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.ComponentModel;

using agvcontroller.Log;

namespace agvcontroller.GUI
{
    /// <summary>
    /// Interaction logic for UCNavagation.xaml
    /// </summary>
    public partial class UCNavagation : UserControl
    {
        Logger Log = new Logger("GUI");

        string _NaviType = "HOME,SYSTEM,SETUP,CONTROL.ALARM,LOG,HELP";

        [Category("Navigation")]
        [Description("Navigation Button Text")]
        public string BtnText
        {
            get
            {
                return lblName.Content.ToString();
            }
            set 
            {
                lblName.Content = value;
            }
        }

        [Category("Navigation")]
        [Description("Navigation Kind")]
        public int NavigationType
        {
            get;
            set;
        }

        List<BitmapImage> ImageList = new List<BitmapImage>();

        public UCNavagation()
        {
            InitializeComponent();

        }

        private void UserControl_Loaded(object sender, RoutedEventArgs e)
        {
            
            if (!string.IsNullOrEmpty(BtnText))
            {
                lblName.Content = BtnText;
            }
            else
            {
                lblName.Content = "Name";
            }

            rectMouseOn.Visibility = Visibility.Hidden;
            rectMouseDown.Visibility = Visibility.Hidden;
            rectNormal.Visibility = Visibility.Visible;
        }

        private void bdEvent_MouseDown(object sender, MouseButtonEventArgs e)
        {
            rectMouseOn.Visibility = Visibility.Hidden;
            rectMouseDown.Visibility = Visibility.Visible;
            rectNormal.Visibility = Visibility.Hidden;
        }

        private void bdEvent_MouseEnter(object sender, MouseEventArgs e)
        {
            rectMouseOn.Visibility = Visibility.Visible;
            rectMouseDown.Visibility = Visibility.Hidden;
            rectNormal.Visibility = Visibility.Hidden;
        }

        private void bdEvent_MouseLeave(object sender, MouseEventArgs e)
        {
            rectMouseOn.Visibility = Visibility.Hidden;
            rectMouseDown.Visibility = Visibility.Hidden;
            rectNormal.Visibility = Visibility.Visible;
        }

        private void bdEvent_MouseUp(object sender, MouseButtonEventArgs e)
        {
            rectMouseOn.Visibility = Visibility.Hidden;
            rectMouseDown.Visibility = Visibility.Hidden;
            rectNormal.Visibility = Visibility.Visible;
        }
    }
}
